package com.yf.tz.service;

import com.yf.service.BaseService;
import com.yf.tz.entity.MallGoodsEntity;

import java.util.List;

/**
 * 产品Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Jul 01 16:32:18 CST 2020
 */
public interface MallGoodsService extends BaseService<MallGoodsEntity> {


    /**

     List<MallGoodsVo> queryListVo(MallGoodsVo mallGoodsVo);

     MallGoodsVo getVo(Long id);
     **/

    /***********BACK***********/

    /***********API***********/

    /**
     * 查找推荐的
     * @return
     */
    List<MallGoodsEntity> findTop();



    List<MallGoodsEntity> findByType(Long typeId);

    List<MallGoodsEntity> findByTypeAndName(Long typeId,String name);

    /**
     * 减少库存
     * @param goodsId
     * @param skuId
     */
    void decreaseStock(Long goodsId,Long skuId,Integer number);

    void validateStock(Long goodsId,Long skuId,Integer number);

    void increaseStock(Long goodsId,Long skuId,Integer number);

}
